import matplotlib.pyplot as plt

from random_walk import RandomWalk

# 创建RandomWalk类的实例
while True:
    rw = RandomWalk()
    rw.fill_walk()
    point_nums = list(range(rw.num_points))
    plt.scatter(rw.x_values,rw.y_values,c=point_nums, s=5,cmap='Blues',
                edgecolor='none')
    # 隐藏坐标轴
    plt.axis('off')

    # 突出起点和终点
    plt.scatter(0,0,c='green',s=100)
    plt.scatter(rw.x_values[-1],rw.y_values[-1],c='red',s=100)

    plt.show()
    keep_running = input("Keep? (y/n)")
    if keep_running=='n':
        break